// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 分页查询菜单 GET /api/menu/ */
export async function selectMenus(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.selectMenusParams,
  options?: { [key: string]: any },
) {
  return request<API.ResponsePagerMenuDataItem>('/api/menu/', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 新增菜单 POST /api/menu/ */
export async function insertMenu(
  body: API.MenuDataItem,
  options?: { [key: string]: any },
) {
  return request<API.ResultBodyMenuDataItem>('/api/menu/', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除多个菜单 DELETE /api/menu/ */
export async function removeMenu(
  body: string[],
  options?: { [key: string]: any },
) {
  return request<API.ResultBodystring>('/api/menu/', {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 查询菜单 GET /api/menu/${param0} */
export async function selectMenu(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.selectMenuParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.ResultBodyMenuDataItem>(`/api/menu/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 更新菜单 PUT /api/menu/${param0} */
export async function updateMenu(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.updateMenuParams,
  body: API.MenuDataItem,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.ResultBodyMenuDataItem>(`/api/menu/${param0}`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    params: { ...queryParams },
    data: body,
    ...(options || {}),
  });
}

/** 删除单个菜单 DELETE /api/menu/${param0} */
export async function insertMenu1(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.insertMenu1Params,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.ResultBodystring>(`/api/menu/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}
